Accusoft.ImagXpress13.Net
Correct Color & Contrast

ImagXpress® provides a suite of methods and properties that enable adjustment of image color. The color of each pixel in an image can be characterized using various color spaces. The Processor class enables the user to modify the color balance within an image by specifying either of the following color spaces:

Modify RGB Levels

To change the levels of red, green and blue in the image, call AdjustRGB method, specifying the amount of change to the red, green and blue components of each pixel (in units or by percentage). Use the RGBColorCount method to identify the red, green, and blue color intensities of the image. This is useful in determining how to set parameters. 

Modify HSL Levels

To change the levels of hue, saturation and luminance in the image, call AdjustHSL, specifying the amount of change to the hue, saturation and luminance components of each pixel (in units or by percentage). 

Modify Luminance/Brightness 

The Brightness method uniformly brightens the current image, by the percent specified. A brightened image has pixels with higher luminance values (in HSL color space), or higher RGB values (in RGB color space) than the original image. 

Automatic Color Balance

The Processor object provides two alternative automatic color balance methods. Each uses a different algorithm to correct color balance. The user has the flexibility to use whichever method works best for the application and image:

Automatic Contrast Correction

The Processor class provides three alternative automatic contrast correction methods. Each uses a different algorithm to correct contrast within the image. The user has the flexibility to use whichever method works best for the application and image:

Modify Gamma

Unfortunately, monitors may output pixel brightness in a non-linear fashion, so that when the image is displayed, the image brightness is not accurately portrayed. Adjusting gamma enables the user to adjust pixel brightness to compensate for the limitations of the display device. The gamma value represents the ratio of input vs. output brightness.

A gamma of one represents a linear relationship between input and output brightness - no change is made to the image. A gamma other than one represents a parabolic relationship between input and output brightness. Applying a gamma greater than one brightens the image, with mid-brightness levels increased more than extremely dark or light pixels. A gamma less than one darkens the image, with mid-brightness levels decreased more than extremely dark or light pixels.

The Gamma method adjusts the brightness of the image based on a parabolic transform, defined by the gamma value. A Gamma value that is greater than one will result in a convex parabolic transform, with the mid-range brightened more than high and low end. A Gamma value that is less than one will result in a concave parabolic transform, with the mid-range darkened more than the high and low end. 

Join or Split RGB Values 

The Processor class also provides the capability to split or join the RGB values of the pixels in the image. To separate the color components of the image, call ColorSeparation. To join the color components of the image, call ColorJoin

You must free the resources associated with each color plane bitmap after it is no longer needed. Call ImageX.DisposeHbitmap to release the resources associated with the handles after use.

Count Colors

The ColorCount method returns the number of pixels of a specified color within the current image or region. This can be useful, for example, in determining whether a check box on a form is filled.   

See Also

 

 


©2018. Accusoft Corporation. All Rights Reserved.

Send Feedback